<style>
	.mpm-list-ico2 {
		color: #999;
		background: #fff;
		display: inline-block;
		padding: 2px;
		line-height: 12px;
		border: 1px solid #ccc;
	}
	.under-line {
		text-decoration: underline;
		color: rgb(41, 158, 236);
	}
</style>
<div class="panel">
  <div class="panel-body">
    <div class="col-lg-12">
      <div class="col-lg-2-4">
        <input type="text" class="form-control" placeholder="产品名称" ng-model="searchform.name">
      </div>
      <div class="col-lg-2-4">
        <ui-select ng-model="searchform.place_code" theme="bootstrap">
          <ui-select-match placeholder="请选择景区">{{$select.selected.name}}</ui-select-match>
          <ui-select-choices repeat="item.code as item in viewarr | filter: $select.search">
            <span ng-bind-html="item.name | highlight: $select.search"></span>
            <span ng-show="item.code">({{item.code}})</span>
          </ui-select-choices>
        </ui-select>
      </div>
      <div class="col-lg-2-4">
        <ui-select ng-model="searchform.state" theme="bootstrap">
          <ui-select-match placeholder="产品状态">{{$select.selected.name}}</ui-select-match>
          <ui-select-choices repeat="item.value as item in statusArr">
            <span ng-bind-html="item.name | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="col-lg-12 mt10">
      <div class="col-lg-2-4">
        <input type="text" class="form-control" placeholder="产品编号" ng-model="searchform.code">
      </div>
      <div class="col-lg-2-4">
        <ui-select ng-model="searchform.sale_category" theme="bootstrap">
          <ui-select-match placeholder="产品分类">{{$select.selected.label}}</ui-select-match>
          <ui-select-choices repeat="item.value as item in dictbytypelist | filter: $select.search">
            <span ng-bind-html="item.label | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
      </div>
      <div class="col-lg-2-4">
        <ui-select ng-model="searchform.channel_code" theme="bootstrap">
          <ui-select-match placeholder="请选择渠道">{{$select.selected.name}}</ui-select-match>
          <ui-select-choices repeat="item.code as item in channel_list | filter: $select.search">
            <span ng-bind-html="item.name | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
	  </div>
	  <div class="col-lg-2">
		<button type="submit" class="btn btn-info" ng-click="load()" style="width: 70%">查询</button>
	  </div>
    </div>
  </div>

  <div style="padding: 0px 15px;"> <div  class="line b-b"></div> </div>
  <div style="padding: 0px 15px;">
	
  </div>

  <div class="col-xs-12 panel panel-body" ng-repeat="item in list">
    <!-- 景区简介 -->
    <div class="col-xs-12">
      <div class="col-xs-3">
        <img src={{item.img||'http://shangke2.oss-cn-qingdao.aliyuncs.com/app/aa/bb/none.jpg'}} alt="景区图片" style="width: 250px; height: 120px;" ng-click="lookImg(item.img)">
      </div>
      <h4 class="col-xs-9">
        <div class="col-xs-12 mt10"><strong>{{item.place_name}}</strong></div>
        <div class="col-xs-12 mt20">地址：{{item.address}}</div>
        <div class="col-xs-12 mt10">
          <button class="btn btn-info btn-xs" ng-click="introduce(item.place_code)">
            <i class="icon-paper-clip"></i> 景区介绍
          </button>
        </div>
      </h4>
    </div>
    <!-- 门票信息 -->
    <div class="col-xs-12 mt10">
      <table class="table table-bordered">
        <thead>
          <th class="text-center" style="min-width: 200px;">基本信息</th>
          <th class="text-center" style="width: 135px;">价格</th>
          <th class="text-center" style="width: 111px;">有效期</th>
          <th class="text-center" style="width: 90px;">产品状态</th>
          <th class="text-center" style="width: 200px;">售卖渠道
            <a class="btn btn-link under-line" style="padding: 0px 5px; vertical-align: baseline;" ng-click="myChannel()">默认渠道</a>
          </th>
          <th class="text-center" style="width: 103px;">公开销售</th>
          <th class="text-center">操作</th>
        </thead>
        <tbody ng-repeat="sale in item.salelist" style="border-top-width: 0px;">
          <tr>
            <td>
              产品名称: {{sale.name_inside}}
              <br/> 产品编号: {{sale.code}}
              <br/> 产品分类: {{sale.sale_category_name}}
              <br/> 供应商名: {{sale.create_company_name}}</td>
            <td>
                分销价: <strong style="color: red;">{{sale.cost_price || 0}}</strong> 元
                <br /> 指导价: <strong style="color: red;">{{sale.guide_price || 0}}</strong> 元
                <br />市场价: {{sale.market_price || 0}} 元
            </td>
            <td class="text-center">{{sale.periodstart}}<br />至<br />{{sale.periodend}}</td>
            <td class="text-center"><br/>
              {{sale.state_name}}<br/>
              <span ng-show="saleState[sale.sale_apply_state]">{{saleState[sale.sale_apply_state]}}</span>
            </td>
            <td>
              <div ng-if="sale.sale_apply_state != 'new'">
                <span ng-bind-html="sale.channel_list_name"></span>
                <br ng-show="sale.channel_list_name"/>
                <a class="btn btn-xs btn-link under-line" ng-click="setChannel(sale)">设置渠道</a>
              </div>
            </td>
            <td>
              <div ng-if="sale.sale_apply_state != 'new'">
                <label class="i-switch bg-success" style="margin-left: 15px;">
                  <input type="checkbox" ng-model="sale.is_selected3" ng-change="change2(sale, sale.is_selected3, $index)"><i></i>
                </label><br/>
                <a class="btn btn-xs btn-link" style="text-decoration: underline; color: rgb(41, 158, 236);" ng-click="setFxs(sale)">设置分销商</a>
              </div>
            </td>
            <td>
              <a ng-show="sale.state=='1'" ng-click="stop(sale.id)" class="btn btn-primary btn-xs">下架</a>
              <a ng-show="(sale.state=='0' || sale.state=='2') && sale.sale_apply_state != 'apply_sale'" ng-click="start(sale.id)" class="btn btn-danger btn-xs">申请上架</a>
              <a ng-click="edit(sale.id, sale.sale_category)" ng-show="(sale.state=='0' || sale.state == '2') && sale.sale_apply_state != 'apply_sale'"
                class="btn btn-success btn-xs">编辑</a>
              <a ng-click="del(sale.id)" ng-show="(sale.state=='0' || sale.state == '2') && sale.sale_apply_state != 'apply_sale'" class="btn btn-danger btn-xs">删除</a>
              <a ng-show="sale.used_state=='1'" ng-click="usedstart(sale.id)" class="btn btn-primary btn-xs">允许消票</a>
              <a ng-show="sale.used_state=='0'" ng-click="usedstop(sale.id)" class="btn btn-danger btn-xs">禁止消票</a>
              <a ng-click="info(sale.id, sale.sale_category)" ng-show="sale.state == '1' || sale.sale_apply_state == 'apply_sale'" class="btn btn-warning btn-xs">详情</a>
              <a ng-show="sale.state=='1' && sale.sale_apply_state == 'for_sale'" ng-click="offSale(sale.id)" class="btn btn-danger btn-xs">禁售</a>
              <a ng-show="sale.state=='1' && sale.sale_apply_state == 'pause'" ng-click="onSale(sale.id)" class="btn btn-success btn-xs">恢复销售</a>
              <a ng-click="distribution(sale.code, sale.sale_target_type)" class="btn btn-default btn-xs" ng-show="sale.sale_target_type == 1">分配经销商</a>
              <a ng-click="skset(sale.id,sale.code,sale.name,sale.guide_price, sale.cost_price)" class="btn btn-default btn-xs" ng-show="(sale.sale_category).indexOf('S') == 0 && sale.state == 1">商客专用设置</a>
              <a ng-click="setImages(sale)" class="btn btn-default btn-xs" has-permission='weshop'>设置信息</a>
              <a ng-click="setPoster(sale)" class="btn btn-default btn-xs" has-permission='weshop'>设置海报</a>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div class="text-right">
    <pagination total-items="totalItems" ng-model="currentPage" ng-change="load(currentPage)" previous-text="上一页" 
    next-text="下一页" first-text="首页" last-text="尾页" max-size="5" boundary-links="true" rotate="false" 
    items-per-page="itemsPerPage" class="m-t-none m-b"></pagination>
  </div>
</div>